﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyVoteMVC.BackstageManagement.Views;
using MyVoteMVC.Domain;
using MyVoteMVC.Common;
using MyVoteMVC.Service;


namespace MyVoteMVC.BackstageManagement.Controllers
{
    public class UsersManagementController : IUsersController
    {  
        private IAuserService auserService;
     
        public UsersManagementController()
        {
            auserService = Factory.GetInstance<IAuserService>();
        }

        public int AddUser(string userEmail, string userRealName, string userPassword, int IsAD, int isLeader)
        {
           return auserService.AddUser(userEmail, userRealName, userPassword, IsAD, isLeader);
        }

        public bool DeleteUser(string userEmailName)
        {
            return auserService.DeleteUser(userEmailName);
        }

        public bool EditUser(string userEmailName, string realName, int isAD, int isLeader)
        {
            return auserService.EditUser(userEmailName, realName, isAD, isLeader);
        }
        public bool EditUser(string userEmailName, string realName, int isAD, int isLeader, string userPassword)
        {
            return auserService.EditUser(userEmailName, realName, isAD, isLeader, userPassword);
        }

        public IList<VT_Users> FindUsersList(string name)
        {
            return auserService.FindUsersList(name);
        }

        //获取普通用户列表
        public IList<VT_Users> GetOrdinaryUsersList()
        {
            return auserService.GetOrdinaryUsersList();
        }
        //获取领导用户列表
        public IList<VT_Users> GetLeaderUsersList()
        {
            return auserService.GetLeaderUsersList();
        }
        //获取管理员列表
        public IList<VT_Users> GetAdministratorList()
        {
            return auserService.GetAdministratorList();
        }
    }
}
